<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Elisa3: irCommunication.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Elisa3
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('ir_communication_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">irCommunication.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="ir_communication_8h_source.html">irCommunication.h</a>&quot;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a8d16ecce7eb417f3f980405b5789cbff">irCommInitTransmitter</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the IR communication state machine in transmission mode (used internally).  <a href="#a8d16ecce7eb417f3f980405b5789cbff"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#abca57372dec6c1f0943be58f5ba8e9a4">irCommInitReceiver</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the IR communication state machine in reception mode (used internally).  <a href="#abca57372dec6c1f0943be58f5ba8e9a4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a50b2c056924fc3ed38cffe0f1d3a04c1">irCommInitVars</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a4edd8fcaedbedf041662d600bb11b040">irCommInit</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the IR communication; need to be called only once.  <a href="#a4edd8fcaedbedf041662d600bb11b040"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a5fff296b971e9be5ce9f8cf3b59aeab2">irCommDeinit</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled.  <a href="#a5fff296b971e9be5ce9f8cf3b59aeab2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a199cb59f8b893d87075fdbc37abedfdc">resetDebugVariables</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#aece295aae9f5e45a418c9f7b52a09059">irCommTasks</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle the internal state machine of the IR communication. Need to be called repeatedly from the main loop.  <a href="#aece295aae9f5e45a418c9f7b52a09059"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a5fb95f3139d0e550050463509be6c389">irCommSendData</a> (unsigned char value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission.  <a href="#a5fb95f3139d0e550050463509be6c389"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a6e430d86600afbcf4b3bf0cae67225f9">irCommDataSent</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell whether the last transmission is terminated or not.  <a href="#a6e430d86600afbcf4b3bf0cae67225f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a62232a7d4be2aeb1c2be79e532e0bef2">irCommDataAvailable</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell whether incoming data are received or not.  <a href="#a62232a7d4be2aeb1c2be79e532e0bef2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#ad54a767f2672a6ad24ce9442567d0e39">irCommReadData</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the last byte received through IR.  <a href="#ad54a767f2672a6ad24ce9442567d0e39"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">signed char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a760431ba471bb88d3614ed49a87e4e86">irCommReceivingSensor</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the last sensor id that receives the message.  <a href="#a760431ba471bb88d3614ed49a87e4e86"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">signed int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ir_communication_8c.html#a1c705dd290385be32f9032724d95eda2">getBearing</a> (unsigned char sensor)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the direction of the sensor that receives the last message.  <a href="#a1c705dd290385be32f9032724d95eda2"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a1c705dd290385be32f9032724d95eda2"></a><!-- doxytag: member="irCommunication.c::getBearing" ref="a1c705dd290385be32f9032724d95eda2" args="(unsigned char sensor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">signed int <a class="el" href="ir_communication_8h.html#a1c705dd290385be32f9032724d95eda2">getBearing</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>sensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the direction of the sensor that receives the last message. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the angle of the sensor (-180..180) </dd></dl>

</div>
</div>
<a class="anchor" id="a62232a7d4be2aeb1c2be79e532e0bef2"></a><!-- doxytag: member="irCommunication.c::irCommDataAvailable" ref="a62232a7d4be2aeb1c2be79e532e0bef2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="ir_communication_8h.html#a62232a7d4be2aeb1c2be79e532e0bef2">irCommDataAvailable</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tell whether incoming data are received or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 if one byte is received, 0 otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a6e430d86600afbcf4b3bf0cae67225f9"></a><!-- doxytag: member="irCommunication.c::irCommDataSent" ref="a6e430d86600afbcf4b3bf0cae67225f9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="ir_communication_8h.html#a6e430d86600afbcf4b3bf0cae67225f9">irCommDataSent</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tell whether the last transmission is terminated or not. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 if the last byte is sent, 0 otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a5fff296b971e9be5ce9f8cf3b59aeab2"></a><!-- doxytag: member="irCommunication.c::irCommDeinit" ref="a5fff296b971e9be5ce9f8cf3b59aeab2" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8h.html#a5fff296b971e9be5ce9f8cf3b59aeab2">irCommDeinit</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Stop the IR communication, only sensors sampling for obstacle and cliff avoidance is enabled. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a4edd8fcaedbedf041662d600bb11b040"></a><!-- doxytag: member="irCommunication.c::irCommInit" ref="a4edd8fcaedbedf041662d600bb11b040" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8h.html#a4edd8fcaedbedf041662d600bb11b040">irCommInit</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the IR communication; need to be called only once. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="abca57372dec6c1f0943be58f5ba8e9a4"></a><!-- doxytag: member="irCommunication.c::irCommInitReceiver" ref="abca57372dec6c1f0943be58f5ba8e9a4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8h.html#abca57372dec6c1f0943be58f5ba8e9a4">irCommInitReceiver</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the IR communication state machine in reception mode (used internally). </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a8d16ecce7eb417f3f980405b5789cbff"></a><!-- doxytag: member="irCommunication.c::irCommInitTransmitter" ref="a8d16ecce7eb417f3f980405b5789cbff" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8h.html#a8d16ecce7eb417f3f980405b5789cbff">irCommInitTransmitter</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the IR communication state machine in transmission mode (used internally). </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a50b2c056924fc3ed38cffe0f1d3a04c1"></a><!-- doxytag: member="irCommunication.c::irCommInitVars" ref="a50b2c056924fc3ed38cffe0f1d3a04c1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8c.html#a50b2c056924fc3ed38cffe0f1d3a04c1">irCommInitVars</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ad54a767f2672a6ad24ce9442567d0e39"></a><!-- doxytag: member="irCommunication.c::irCommReadData" ref="ad54a767f2672a6ad24ce9442567d0e39" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned char <a class="el" href="ir_communication_8h.html#ad54a767f2672a6ad24ce9442567d0e39">irCommReadData</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the last byte received through IR. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the byte received </dd></dl>

</div>
</div>
<a class="anchor" id="a760431ba471bb88d3614ed49a87e4e86"></a><!-- doxytag: member="irCommunication.c::irCommReceivingSensor" ref="a760431ba471bb88d3614ed49a87e4e86" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">signed char <a class="el" href="ir_communication_8h.html#a760431ba471bb88d3614ed49a87e4e86">irCommReceivingSensor</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the last sensor id that receives the message. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the sensor id (0..7); 0 is the front sensor, sensors id increases clockwise </dd></dl>

</div>
</div>
<a class="anchor" id="a5fb95f3139d0e550050463509be6c389"></a><!-- doxytag: member="irCommunication.c::irCommSendData" ref="a5fb95f3139d0e550050463509be6c389" args="(unsigned char value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8h.html#a5fb95f3139d0e550050463509be6c389">irCommSendData</a> </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value,:</td><td>byte to be sent; sensor: sensor id mask (bit 0 corresponds to sensor 0 in front of robot, id increases clockwise). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>none Set the data to be sent through IR; the obstacle avoidance and cliff avoidance will be disabled during the transmission. </dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">value,:</td><td>byte to be sent; sensor. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="aece295aae9f5e45a418c9f7b52a09059"></a><!-- doxytag: member="irCommunication.c::irCommTasks" ref="aece295aae9f5e45a418c9f7b52a09059" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8h.html#aece295aae9f5e45a418c9f7b52a09059">irCommTasks</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Handle the internal state machine of the IR communication. Need to be called repeatedly from the main loop. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a199cb59f8b893d87075fdbc37abedfdc"></a><!-- doxytag: member="irCommunication.c::resetDebugVariables" ref="a199cb59f8b893d87075fdbc37abedfdc" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="ir_communication_8c.html#a199cb59f8b893d87075fdbc37abedfdc">resetDebugVariables</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="ir_communication_8c.html">irCommunication.c</a>      </li>

    <li class="footer">Generated on Thu Dec 4 2014 08:30:49 for Elisa3 by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
